package com.yantong.service;

import com.yantong.utils.PageUtils;
import com.yantong.pojo.vo.ListWorkOrderVo;
import com.yantong.pojo.WorkComment;
import com.yantong.pojo.WorkConfig;
import com.yantong.pojo.WorkOrder;

import java.util.Date;
import java.util.List;

/**
 * 售后工单服务
 * @author kanghaixin
 * @date 2018/9/3.16:37
 */
public interface WorkOrderService {



    /**
     * 更新工单
     * @param workOrder
     * @return
     */
    int update(WorkOrder workOrder);

    /**
     * 工单详情
     * @param workId
     * @return
     */
    WorkOrder getByKey(Long workId);

    /**
     * 获取工单回复记录列表
     * @param workId
     * @return
     */
    List<WorkComment> getWorkComment(Long workId);




    /**
     * 获取财务工单列表
     * @param queryItem
     * @param status
     * @param start
     * @param end
     * @param centreId
     * @param offset
     * @param limit
     * @return
     */
    PageUtils<WorkOrder> listFinanceWorkOrders(String queryItem, Integer status, Long centreId, Date start, Date end, int offset, int limit);

    /**
     * 获取财务工单列表  不分页
     * @param queryItem
     * @param status
     * @param centreId
     * @param start
     * @param end
     * @return
     */
    List<WorkOrder> listFinanceWorkOrders(String queryItem, Integer status, Long centreId, Date start, Date end);

    /**
     * 财务拒绝工单
     * @param workOrder
     * @return
     */
    int financeRefuseWork(WorkOrder workOrder);


    /**
     * 售后工单列表数据，分页
     * @param listWorkOrderVo
     * @param offset
     * @param limit
     * @return
     */
    PageUtils<WorkOrder> listWorkOrders(ListWorkOrderVo listWorkOrderVo, int offset, int limit);


    /**
     * 售后工单总计
     * @param params
     * @return
     */
    String sumWorkMoney(ListWorkOrderVo listWorkOrderVo);

    /**
     * 售后工单列表  不分页
     * @param listWorkOrderVo
     * @return
     */
    List<WorkOrder> listWorkOrder(ListWorkOrderVo listWorkOrderVo);

    /**
     * 新增工单回复
     * @param workComment
     * @return
     */
    int saveWorkComment(WorkComment workComment);

    /**
     * 关闭工单
     * @param workOrder
     * @return
     */
    int closeWork(WorkOrder workOrder);

    /**
     * 工单移交财务处理
     * @param workOrder
     * @return
     */
    int forwardCw(WorkOrder workOrder);


    /**
     * 财务退款操作
     * @param workId
     * @param aid
     * @param aName
     * @return
     */
    int cwRefund(Long workId, Long aid, String aName);

    /**
     * 保存商户工单时效配置
     * @param config
     * @return
     */
    int saveWorkOutTimeConfig(WorkConfig config);

    /**
     * 新增售后工单
     * @param workOrder
     * @return
     */
    int saveWorkOrder(WorkOrder workOrder);

    /**
     * 门店撤销售后工单
     * @param workId
     * @return
     */
    int cancelWorkOrder(Long workId);
}
